<template>
	<view class="">
		<view class="main_type box_redius">
			<view class="box" v-for="item in troubleList" :key="item.id" @click="goToUrl(item.id)">
				<image :src="item.image" mode=""></image>
				<view class="text">{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		technicalCategoryList
	} from '@/api/index.js'
	export default {
		data() {
			return {
				troubleList: []
			}
		},
		mounted() {
			this.gettechnicalCategoryList()
		},
		methods: {
			//故障排查分类列表
			gettechnicalCategoryList() {
				technicalCategoryList().then(res => {
					this.troubleList = res.data
				})
			},
			goToUrl(id) {
				uni.navigateTo({
					url: '/pages/malfunction/index?cid=' + id
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main_type {
		display: grid;
		grid-template-columns: repeat(3, 33.33%);

		.box {
			text-align: center;
			margin: 20rpx 0 10rpx 0;

			image {
				height: 98rpx;
				width: 98rpx;
			}

			.text {
				margin-top: 10rpx;

			}
		}
	}
</style>
